/**
 * @file skoll.actions.content.search.js
 * @author Alejandro Dario Simi
 * @date $Date: 2014-05-04 01:33:52 +0000 (Sun, 04 May 2014) $
 *
 * $Id: skoll.actions.content.search.js 111 2014-05-04 01:33:52Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/trunk/skins/Skoll/js/skoll.actions.content.search.js $
 */

Skoll.actions.content.search = {
	//
	// Protected properties.
	//
	// Public methods.
	sendQuery: function(form) {
		Skoll.tools.preventDefault();
		Skoll.actions.sidetools.search.setPattern($(form).find("#pattern").val());

		var type = $(form).find("#SearchType").val();
		var url = "?action=content:search&group=" + GROUP_ID + "&pattern=" + $(form).find("#pattern").val().replace(/ /g, "%20");

		var exceptions = $(form).find("#exceptions").val().replace(/ /g, "%20");
		if (exceptions != "") {
			url += "&exceptions=" + exceptions;
		}

		$.each($(form).find("#Types").find("input:checked"), function(key, item) {
			url += "&" + $(item).attr("name") + "=on";
		});

		document.location.href = url;
	}
	//
	// Protected methods.
};
